package br.com.jk.valealim.cartaovenda;

import java.io.InputStream;
import java.sql.SQLException;
import br.com.jk.util.ReportUtil;
import br.com.jk.util.Util;
import net.sf.jasperreports.engine.JRException;

/**
 *
 * @author camilo
 */
public class CartaoVendaReport {

  private InputStream reportUltVenda = getClass().getResourceAsStream("reports/CartaoVenda-UltVenda.jasper");

  public void geraReportUltVenda() throws JRException, SQLException, ClassNotFoundException {
    try {
      ReportUtil.getReport(this.reportUltVenda, "Relatório da última venda (comprovante)");
    } catch (Exception e) {
      Util.msgErro(e, "Erro no relatório");
    }
  }

  public InputStream getReportUltVenda() {
    return reportUltVenda;
  }

  public void setReportUltVenda(InputStream reportUltVenda) {
    this.reportUltVenda = reportUltVenda;
  }
}
